import hmac
import hashlib
import base64


key = "bK9jk5dBEtjauy6gXL7vZCPJ1fOy076H"
message =  'GET\napplication/json, text/plain, */*\n\n\n\nx-ca-key:203899271\nx-ca-nonce:1f34bb1d-1fc2-42a7-bd0e-eff0d9837c72\n/community-cloud/v1/homepage/community/by/tag?deviceType=PC&tagId=7'

h = hmac.new(key.encode('utf-8'),message.encode('utf-8'),hashlib.sha256).digest()
signature = base64.b64encode(h).decode()
print(signature)


